<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.w3.org/1999/xhtml">

<head>
    <th:block th:include="common/common_head :: commonHeader('银行信息列表')"/>
    <link rel="stylesheet" th:href="@{/static/js/plugins/jquery-layout/jquery.layout-latest.css}">
</head>

<body class="gray-bg">

<div class="container-div ui-layout-center">
    <div class="row">
        <div class="col-sm-12 search-condition">
            <form id="bankForm" th:action="@{/vendorBankInfo/list}" class="form-inline">
                <!-- <input type="hidden" name="deptId" id="deptId"/> -->
                <div class="select-list">
                    <ul>
                        <li class="col-sm-3">
                            <label>供应商名称：</label>
                            <input type="text" name="vendorName" />
                        </li>
                        <li  class="col-sm-3">
                            <button id="bankSearchBtn" type="button" class="btn btn-primary btn-rounded btn-sm"><i class="fa fa-search"></i>&nbsp;搜索</button>
                            <button class="btn btn-warning btn-rounded btn-sm" type="reset"><i class="fa fa-eraser"></i>&nbsp;重置</button>
                            <button id="bankAdvancedSearch" type="button" class="btn btn-primary btn-rounded btn-sm" style="display: none"><i class="fa fa-caret-down"></i>&nbsp;高级搜索</button>
                        </li>
                    </ul>

                </div>
            </form>
        </div>
        <div class="col-sm-12 select-info">
            <div class="col-sm-12 select-info">
            <div class="btn-group hidden-xs toolbar" id="bankToolBar" role="group">
                <a class="btn btn-outline btn-success btn-rounded" onclick="toVendorBankInfo()"
                   shiro:hasPermission="vendor:save">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <a class="btn btn-outline btn-success btn-rounded" onclick="toEditVendorBankInfo()">
                    <i class="fa fa-edit"></i> 编辑
                </a>
                <!-- <a class="btn btn-outline btn-danger btn-rounded" onclick="deleteUser()">
                    <i class="fa fa-remove"></i> 删除
                </a> -->
            </div>
            <table id="bank"></table>
        </div>
    </div>
  </div>
</div>
<!--引入公共js-->
<div th:include="common/onload_js :: onloadJS"></div>
<script type="text/javascript" th:src="@{/static/js/plugins/jquery-layout/jquery.layout-latest.js}"></script>
<!-- Page-Level Scripts -->
<script type="text/javascript">
    //面向对象
    var searcherBS = Searcher.createBS('#bank',
        [
            {checkbox: true},
            {title: '供应商',field:"vendorName"},
            {title: "银行国际", field:"bankI18n"},
            {title: "银行代码 ",field:"bankCode"},
            {title: "银行账号",field:"bankAccountNo"},
            {title: "银行开户行",field:"bankOpen"}
        ]
    );
    
    /**
     * 查询数据
     */
    function refresh() {
    	searcherBS.refresh();
    }
    
    /**
     * 跳转至新增页
     */
    function toVendorBankInfo() {
        var index=Dialog.openUrl("新增供应商", ctxPath + '/modules/bank/bank_add.html',{area : ['900px','700px'],
            maxmin: true,
            end: function() {}
        });
        layer.full(index);
    }
    
    //跳转至编辑页
    function toEditVendorBankInfo() {
        var rowDatas = searcherBS.getSelectedRows("pkId");
        if (rowDatas.length != 1) {
            Dialog.errorMsg("请选择一行进行编辑");
            return;
        }
		var index = Dialog.openUrl("编辑供应商信息", ctxPath + '/vendorBankInfo/toEdit/'+rowDatas,
		    {area : ['900px','700px'],
			  maxmin: true,
		      end: function () {}
		    });
		layer.full(index);
    }
</script>
</body>
</html>